﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Carlife.Inf.Migrations
{
    public partial class desc : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Billingby",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contract = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContractType = table.Column<int>(type: "int", nullable: false),
                    Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Companyphonenumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TaxpayerIdentificationnumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Thecompany = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Thecompanyopensanaccount = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sendinvoicetorecipient = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CustomerId = table.Column<int>(type: "int", nullable: false),
                    IsData = table.Column<bool>(type: "bit", nullable: false,defaultValue:"False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Billingby", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Brand",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BrandName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Pid = table.Column<int>(type: "int", nullable: false),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Brand", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "CarLeaseProject",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ChannelId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BrandId = table.Column<int>(type: "int", nullable: true),
                    SeriesID = table.Column<int>(type: "int", nullable: true),
                    VersionID = table.Column<int>(type: "int", nullable: true),
                    Color = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PuidePrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    SpecificConfiguration = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LeaseCategory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    leaseNum = table.Column<int>(type: "int", nullable: true),
                    ProvinceId = table.Column<int>(type: "int", nullable: true),
                    CityId = table.Column<int>(type: "int", nullable: true),
                    Ownership = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Checked = table.Column<int>(type: "int", nullable: true),
                    Projectinitiationtime = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()"),
                    Businesshandling = table.Column<int>(type: "int", nullable: true),
                    Customer = table.Column<int>(type: "int", nullable: true),
                    Drivingexperience = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Localresidence = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Localdriving = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProjectApprovalDate = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UserPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IDCard = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaritalStatus = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PreviousEmployer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WorkTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    Department = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Position = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DrivingYears = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentDwellTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentDrivingYears = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MateName = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    Re_Phone = table.Column<string>(type: "Nvarchar(11)", nullable: true),
                    UserLeaseID = table.Column<string>(type: "Nvarchar(18)", nullable: true),
                    Monthlyincome = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Professional = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    Whetherornot = table.Column<string>(type: "Nvarchar(2)", nullable: true),
                    job = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    Situation = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    Income = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Tenement = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    Other = table.Column<string>(type: "Nvarchar(200)", nullable: true),
                    ContractNo = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CarLeaseProject", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Client",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ClientId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ClientName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Phone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ClientTypeId = table.Column<int>(type: "int", nullable: true),
                    IdNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RankId = table.Column<int>(type: "int", nullable: true),
                    Progress = table.Column<int>(type: "int", nullable: true),
                    NumberofContracts = table.Column<int>(type: "int", nullable: true),
                    NumberofOverdues = table.Column<int>(type: "int", nullable: true),
                    Isoverdueid = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ChannelSource = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Marriage = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ResidentialAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Workplace = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Department = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DrivingAge = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LengthOfStay = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    workingHours = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Posts = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SocialID = table.Column<int>(type: "int", nullable: true),
                    RentStartTime = table.Column<DateTime>(type: "datetime2", nullable: false,defaultValueSql:"getdate()"),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Client", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Clienttype",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Clienttype", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Deposit",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ClientId = table.Column<int>(type: "int", nullable: true),
                    ClientTypeId = table.Column<int>(type: "int", nullable: true),
                    Count = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContractBond = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    AmountRefunded = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    RemainingMargin = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    BusinessManagementID = table.Column<int>(type: "int", nullable: true),
                    MoneystateID = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false,defaultValue:"False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Deposit", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Districjs",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Pid = table.Column<int>(type: "int", nullable: false),
                    Name = table.Column<string>(type: "Nvarchar(100)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false,defaultValue:"False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Districjs", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Licenseplate",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LiName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Pid = table.Column<int>(type: "int", nullable: false),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Licenseplate", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Limits",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Parent_id = table.Column<int>(type: "int", nullable: true),
                    LimitsName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LimitsDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Limits", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Minimumrent",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Reasons = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    FileName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
                    FilePath = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
                    CustomerId = table.Column<int>(type: "int", nullable: false),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Minimumrent", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "RelationshipBiao",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Communication = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RelationshipName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LianXiDianHua = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RelationshipBiao", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Repayment",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ClientId = table.Column<int>(type: "int", nullable: true),
                    ClientTypeId = table.Column<int>(type: "int", nullable: true),
                    Count = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Rent = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Surplusrent = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    RentalDay = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()"),
                    DelayedInterest = table.Column<int>(type: "int", nullable: true),
                    BusinessManagementID = table.Column<int>(type: "int", nullable: true),
                    IsoverdueID = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Repayment", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "RoleLimits",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Role_ID = table.Column<int>(type: "int", nullable: true),
                    LimitsID = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RoleLimits", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Roles",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Parent_id = table.Column<int>(type: "int", nullable: true),
                    Account = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RoleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Roles", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Secondary",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DropName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PID = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Secondary", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Setupaproject",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Opinion = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    Reasons = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    FileName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
                    FilePath = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
                    CustomerId = table.Column<int>(type: "int", nullable: false),
                    MinimumId = table.Column<int>(type: "int", nullable: false),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Setupaproject", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SocialRelationships",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FamilyMembers = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Relationship = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MonthlyIncome = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Children = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Urgent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SContact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sidentitycard = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    JobTitle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Guarantee = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RelationshipID = table.Column<int>(type: "int", nullable: true),
                    OtherIncome = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    TypeOfHouse = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SocialRelationships", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_AccidentRecord",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Accidentdate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Accidentspot = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Driver = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Accidentcause = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Damagedcondition = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Processingscheme = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Accidentphotograph = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Instockid = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_AccidentRecord", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_Car",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Pid = table.Column<int>(type: "int", nullable: true),
                    Level = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_Car", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_CarInsurance",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Insurancecontract = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Commercialinsurancecontractnumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Insurancecompany = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Periodofinsurance = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Premium = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Dateofinsurance = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Insuredata = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Instockid = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_CarInsurance", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_CarPicture",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Carcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Prcturename = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Cardescribe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_CarPicture", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_InStockCar",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Purchaseid = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Carcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Roadhaul = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Vehiclestate = table.Column<int>(type: "int", nullable: true),
                    Platenumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Framennumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Income = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Expenditure = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Brandid = table.Column<int>(type: "int", nullable: true),
                    Seriesid = table.Column<int>(type: "int", nullable: true),
                    Versionid = table.Column<int>(type: "int", nullable: true),
                    Color = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Specificconfiguration = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Otherstoragecharges = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Gpsexpense = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Registrationfee = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Purchasetax = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Enginenumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sanjiid = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_InStockCar", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_jaiojie",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Qiyue = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Username = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Kehulei = table.Column<int>(type: "int", nullable: false),
                    Number = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Yewujing = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Guishu = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    State = table.Column<int>(type: "int", nullable: true),
                    Lidate = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()"),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_jaiojie", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_Maintenance",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Servicedates = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()"),
                    Maintainceplace = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Maintaincecontent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Incurexpense = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Maintenancecycle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Otherrecords = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Backmatter = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Instockid = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_Maintenance", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_Purchase",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PurchaseOrderCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContractCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurchaseQuantity = table.Column<int>(type: "int", nullable: true),
                    BuyerID = table.Column<int>(type: "int", nullable: true),
                    Buyer = table.Column<int>(type: "int", nullable: true),
                    State = table.Column<int>(type: "int", nullable: true),
                    Auditoridd = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Auditor = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditDate = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()"),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_Purchase", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_PurchaseDetail",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Purchaseordercode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Brandid = table.Column<int>(type: "int", nullable: true),
                    Seriesid = table.Column<int>(type: "int", nullable: true),
                    Versionid = table.Column<int>(type: "int", nullable: true),
                    Color = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Number = table.Column<int>(type: "int", nullable: true),
                    Puideprice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_PurchaseDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_PurchaseSupplier",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Purchaseordercode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Supplierid = table.Column<int>(type: "int", nullable: true),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Supplieraddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contacts = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Phone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Supplierbank = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Supplierbankaccount = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Totalfee = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Carinfo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_PurchaseSupplier", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_SalesLog",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Logpeoplename = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Operationtime = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()"),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_SalesLog", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_SalesScheme",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Sid = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Brandid = table.Column<int>(type: "int", nullable: true),
                    Seriesid = table.Column<int>(type: "int", nullable: true),
                    Versionid = table.Column<int>(type: "int", nullable: true),
                    Firstmoney = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Issue = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Monthrepayment = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Finalpayment = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Officialguideprice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    State = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_SalesScheme", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tb_sanji",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CarNames = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Pid = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_sanji", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Urge",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ClientId = table.Column<int>(type: "int", nullable: true),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Client = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Count = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Contractmoney = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Returnmoney = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Leftmoney = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ClientTypeId = table.Column<int>(type: "int", nullable: true),
                    BusinessId = table.Column<int>(type: "int", nullable: true),
                    MoneystateID = table.Column<int>(type: "int", nullable: true),
                    Starttime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    Endtime = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()"),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Urge", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "UserInfo",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Login_Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Password = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RealName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EnglishName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Gender = table.Column<bool>(type: "bit", nullable: true),
                    Phone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Enabled = table.Column<bool>(type: "bit", nullable: true),
                    Type = table.Column<bool>(type: "bit", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfo", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "UserLeaseRelation",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Contactperson = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    Relation = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    Contactinformation = table.Column<string>(type: "Nvarchar(40)", nullable: true),
                    CustomerId = table.Column<int>(type: "int", nullable: false),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserLeaseRelation", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "UserRole",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UsleID = table.Column<int>(type: "int", nullable: true),
                    RoleID = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserRole", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Users",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Login_Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Password = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RealName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EnglishName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Gender = table.Column<bool>(type: "bit", nullable: true),
                    Phone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Enabled = table.Column<bool>(type: "bit", nullable: true),
                    Type = table.Column<int>(type: "int", nullable: true),
                    DropID = table.Column<int>(type: "int", nullable: true),
                    DropName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PID = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Users", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Billingby");

            migrationBuilder.DropTable(
                name: "Brand");

            migrationBuilder.DropTable(
                name: "CarLeaseProject");

            migrationBuilder.DropTable(
                name: "Client");

            migrationBuilder.DropTable(
                name: "Clienttype");

            migrationBuilder.DropTable(
                name: "Deposit");

            migrationBuilder.DropTable(
                name: "Districjs");

            migrationBuilder.DropTable(
                name: "Licenseplate");

            migrationBuilder.DropTable(
                name: "Limits");

            migrationBuilder.DropTable(
                name: "Minimumrent");

            migrationBuilder.DropTable(
                name: "RelationshipBiao");

            migrationBuilder.DropTable(
                name: "Repayment");

            migrationBuilder.DropTable(
                name: "RoleLimits");

            migrationBuilder.DropTable(
                name: "Roles");

            migrationBuilder.DropTable(
                name: "Secondary");

            migrationBuilder.DropTable(
                name: "Setupaproject");

            migrationBuilder.DropTable(
                name: "SocialRelationships");

            migrationBuilder.DropTable(
                name: "tb_AccidentRecord");

            migrationBuilder.DropTable(
                name: "tb_Car");

            migrationBuilder.DropTable(
                name: "tb_CarInsurance");

            migrationBuilder.DropTable(
                name: "tb_CarPicture");

            migrationBuilder.DropTable(
                name: "tb_InStockCar");

            migrationBuilder.DropTable(
                name: "tb_jaiojie");

            migrationBuilder.DropTable(
                name: "tb_Maintenance");

            migrationBuilder.DropTable(
                name: "tb_Purchase");

            migrationBuilder.DropTable(
                name: "tb_PurchaseDetail");

            migrationBuilder.DropTable(
                name: "tb_PurchaseSupplier");

            migrationBuilder.DropTable(
                name: "tb_SalesLog");

            migrationBuilder.DropTable(
                name: "tb_SalesScheme");

            migrationBuilder.DropTable(
                name: "tb_sanji");

            migrationBuilder.DropTable(
                name: "Urge");

            migrationBuilder.DropTable(
                name: "UserInfo");

            migrationBuilder.DropTable(
                name: "UserLeaseRelation");

            migrationBuilder.DropTable(
                name: "UserRole");

            migrationBuilder.DropTable(
                name: "Users");
        }
    }
}
